<script setup>
import { onMounted,ref } from 'vue';
import  axios  from 'axios';
let userlist=ref("")
function init(){
    axios.get("http://localhost:8080/query"
    ).then((res) => {
    if (res.status == 200) {
      let list = res.data;
      if (list.code == 200) {
       userlist.value=list.data
       
      }
    }
  })
}
onMounted(()=>{
    init();
})
</script>

<template>
<el-table :data="userlist" style="width: 100%">
    <el-table-column prop="name" label="用户名" width="180" />
    <el-table-column prop="password" label="密码" width="180" />
    <el-table-column  label="头像" >
      <img :src="img">
    </el-table-column>
  </el-table>
</template>

<style scoped>
img{
  height:150px;
  width:150px;
}
</style>
